<?php
/**
 * Created by PhpStorm.
 * User: 'mrzhan'
 * Date: 2021/1/7
 * Time: 23:47
 */

namespace App\Controller;


use Hyperf\Config\Annotation\Value;
use Hyperf\Contract\ConfigInterface;
use Hyperf\Di\Annotation\Inject;
use Hyperf\HttpServer\Annotation\AutoController;

/**
 * @AutoController()
 */
class ConfigController
{

    /**
     * @Inject()
     * @var ConfigInterface
     */
    private $config;

    /**
     * @Value("foo.bar")
     */
    private $bar;


    public function getConfig()
    {
        return $this->config->get('foo.bar');
    }

    public function value()
    {
        return $this->bar;
    }

    public function config()
    {
        return config('foo.bar');
    }



}
